import http from '@/utils/axios';

// 获取列表数据
export const getConfigGroupListApi = () => {
    return http({
        method: 'get',
        url: '/sys_config_group/index',
    });
};

// 获取数据
export const getConfigGroupInfoApi = (id: number) => {
    return http({
        method: 'GET',
        url: `/sys_config_group/read/${id}`,
    });
};

// 新增数据
export const saveConfigGroupInfoApi = (data: any) => {
    return http({
        method: 'POST',
        url: `/sys_config_group/save`,
        data,
    });
};

// 更新数据
export const updateConfigGroupInfoApi = (id: number, data: any) => {
    return http({
        method: 'PUT',
        url: `/sys_config_group/update/${id}`,
        data,
    });
};

// 删除数据
export const deleteConfigGroupInfoApi = (id: number): Promise<void> => {
    return http({
        method: 'DELETE',
        url: `/sys_config_group/delete/${id}`,
    });
};